<template>
  <div class="header">
    <van-row>
      <!-- 分三列 -->
      <!-- 左面部分Icon -->
      <van-col span="4">
        <span class="iconfont icon-fanhui fanhui" v-if="left" @click="goLastPage"></span>
      </van-col>
      <!-- 中间文字部分 -->
      <van-col span="16">
        <span class="goods_desc_font">{{title}}</span>
      </van-col>
      <!-- 右面Icon部分 -->
      <van-col span="4">
        <slot name="right_icon"></slot>
      </van-col>
    </van-row>
  </div>
</template>
<script>
export default {
  name:"Header",
  props:["title","left"],
  data() {
    return {
      
    }
  },
  methods: {
    // 返回上一个页面
    goLastPage(){
      this.$router.go(-1);
    }
  },
}
</script>
<style lang="less" scoped>
  .header{
    position: fixed;
    top: 0rem;
    width: 100%;
    height: 0.45rem;
    background-color: #ffffff;
    font-size: 0rem;
    z-index: 999;
  }

  .fanhui{
    font-size: 0.23rem;
    color: #1E1E1E;
    width: 0.23rem;
    height: 0.25rem;
  }
  .van-row{
    height: 100%;
  }
  .van-col{
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .goods_desc_font{
    font-size: 0.16rem;
    font-weight: bold;
  }

</style>